package ace.module.account.core.impl.manager;

import ace.module.account.api.model.dto.IamAccountPasswordDto;
import ace.module.account.core.impl.dao.entity.IamAccount;
import ace.module.account.core.impl.dao.entity.IamAccountPassword;
import ace.module.common.core.impl.manager.EntityOfAppManager;
import java.util.List;

/**
 * @author caspar
 * @date 2023/3/20 9:28
 */
public interface IamAccountPasswordManager
    extends EntityOfAppManager<IamAccountPassword, Long, IamAccountPasswordDto> {

  List<IamAccountPassword> getByIamAppIdAndPassportAndPassportTypes(
      Long iamAppId, String passport, List<Integer> passportTypes);

  List<IamAccountPassword> getByIamAppIdAndTagAndPassportAndPassportTypes(
      Long iamAppId, String tag, String passport, List<Integer> passportTypes);

  IamAccountPassword getByIamAppIdAndPassportAndPassportType(
      Long iamAppId, String passport, Integer passportType);

  IamAccountPassword getAndCheckAllById(Long accountId);

  List<IamAccountPassword> getByAccountIdIn(List<Long> iamAccountIds);

  IamAccountPassword build(Long accountId, Long iamAppId, String password);

  String encodePassword(String password);

  void addOrModifyIfPasswordIsNotEmpty(IamAccount iamAccount, String password);
}
